﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Views/Shared/Default.Master" CodeBehind="List.aspx.cs" Inherits="AcademicPlanner.Presentation.Views.Courses.List" %>

<%@ Import Namespace="AcademicPlanner.Framework.Helpers" %>
<%@ Import Namespace="AcademicPlanner.Presentation.Views.Shared" %>

<asp:Content ID="Content1" ContentPlaceHolderID="headplace" runat="server"></asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="pageheadingplace" runat="server">
	<%= Html.Encode(pageHeading) %>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="contentplace" runat="server">
	<%
		var vLinks = WidgetHelper.PageLinks((int)Model.PageNumber, CoursesPage.LastPageNumber,
											SecurityHelper.UrlDecode(Url.Action("List", "Courses", new { pId = Model.AcademicPlan.EntityId,
																				pPage = "{0}"})),
											PaginationRadius);
	%>	
	<%= WidgetHelper.DialogBlock("saveCourseDialog", Html.Encode(Tr("Enter course information")), "") %>
	<h2 class="top-actions right-aligned">
		<%= Html.ActionLink(Html.Encode(Tr("Create Course")), 
			"CourseForm", "Controls", 
			new { pScenario = CourseFormScenario.CREATE, pCourseId = 0, pPlanId = Model.AcademicPlan.EntityId }, 
			new { onclick = "return gListCoursesPageCtrl.handleCreateCourse(event, this)" }) %>
	</h2>
	<%= WidgetHelper.PageTipBlock(pageTip) %>
	<div class="right"><%= vLinks %></div>
	<%= Html.ClearBreak() %>
	<%= Html.Break(2) %>
	<% Html.RenderPartial("CoursesControl", ViewCoursesModel); %>
	<%= Html.Break(2) %>
	<div class="right"><%= vLinks %></div>
	<%= Html.ClearBreak() %>
	<script type="text/javascript">
		gDomReadyQueue.push('gListCoursesPageCtrl.init();');
		gListCoursesPageCtrl.buttonTexts.submit = '<%= SecurityHelper.Escape(Tr("Save")) %>';
		gListCoursesPageCtrl.buttonTexts.cancel = '<%= SecurityHelper.Escape(Tr("Cancel")) %>';
	</script>
</asp:Content>
